package seismosurfer.gui.menuitem;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import seismosurfer.layer.QuakeLayer;

import com.bbn.openmap.gui.menu.MapHandlerMenuItem;

/**
 * This menu item shows the earthquakes for which
 * macroseismic data are available in the map.
 *
 */
public class QuakesWithMacroMenuItem extends MapHandlerMenuItem implements
        ActionListener {
    
    private static final long serialVersionUID = 7933354293979735563L;

    protected QuakeLayer ql;

    public QuakesWithMacroMenuItem() {
        super("Earthquakes With Macroseismic Data");
        addActionListener(this);
    }

    public void actionPerformed(ActionEvent ae) {

        if (ql != null) {
            ql.loadQuakeClientData("QUAKES_WITH_MACRO", null);
        } else {
            System.out.println("NULL Layer!!!");
        }
    }

    public void findAndInit(Object someObj) {
        super.findAndInit(someObj);

        if (someObj instanceof QuakeLayer) {
            ql = (QuakeLayer) someObj;
        }

    }

    public void findAndUndo(Object someObj) {
        super.findAndUndo(someObj);

    }

}
